/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jsf.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author gang
 */
@Entity
@Table(name = "channel")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Channel.findAll", query = "SELECT c FROM Channel c")})
public class Channel implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "chlid")
    private Integer chlid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 30)
    @Column(name = "chlname")
    private String chlname;
    @Size(max = 30)
    @Column(name = "chllink")
    private String chllink;
    @Column(name = "cretime")
    @Temporal(TemporalType.TIMESTAMP)
    private Date cretime;
    @Column(name = "creuserid")
    private Integer creuserid;
    @Size(max = 30)
    @Column(name = "crepusername")
    private String crepusername;
    @Column(name = "status")
    private Boolean status;
    @Size(max = 10)
    @Column(name = "type")
    private String type;
    @Size(max = 10)
    @Column(name = "chllevel")
    private String chllevel;
    @Size(max = 30)
    @Column(name = "remark")
    private String remark;

    public Channel() {
    }

    public Channel(Integer chlid) {
        this.chlid = chlid;
    }

    public Channel(Integer chlid, String chlname) {
        this.chlid = chlid;
        this.chlname = chlname;
    }

    public Integer getChlid() {
        return chlid;
    }

    public void setChlid(Integer chlid) {
        this.chlid = chlid;
    }

    public String getChlname() {
        return chlname;
    }

    public void setChlname(String chlname) {
        this.chlname = chlname;
    }

    public String getChllink() {
        return chllink;
    }

    public void setChllink(String chllink) {
        this.chllink = chllink;
    }

    public Date getCretime() {
        return cretime;
    }

    public void setCretime(Date cretime) {
        this.cretime = cretime;
    }

    public Integer getCreuserid() {
        return creuserid;
    }

    public void setCreuserid(Integer creuserid) {
        this.creuserid = creuserid;
    }

    public String getCrepusername() {
        return crepusername;
    }

    public void setCrepusername(String crepusername) {
        this.crepusername = crepusername;
    }

    public Boolean getStatus() {
        return status;
    }

    public void setStatus(Boolean status) {
        this.status = status;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getChllevel() {
        return chllevel;
    }

    public void setChllevel(String chllevel) {
        this.chllevel = chllevel;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (chlid != null ? chlid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Channel)) {
            return false;
        }
        Channel other = (Channel) object;
        if ((this.chlid == null && other.chlid != null) || (this.chlid != null && !this.chlid.equals(other.chlid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.jsf.entity.Channel[ chlid=" + chlid + " ]";
    }
    
}
